package com.clstu.enum_.homework;

public class HomeWork06 {
    public static void main(String[] args) {
        Car car = new Car(31);
        Car car1 = new Car(9);
        Car car2 = new Car(25);
        car.flow();
        car.flow();
        car1.flow();
        car1.flow();
        car2.flow();
    }
}
class Car{
    private double temperature;

    public Car(double temperature) {
        this.temperature = temperature;
    }
    class Air{
        public void flow(){
            if(temperature<10){
                System.out.println("温度较低，制热模式。。");
                temperature=temperature+25;
                return;
            }
            if(temperature>30){
                System.out.println("气温较高，制冷模式");
                temperature=temperature-25;
                return;
            }
            System.out.println("温度适宜，无需开启空调。。3秒后自动关闭。。");
        }
    }
    Air air=new Air();
    public void flow(){
        air.flow();
    }
}